package com.ctshk.rpc.order.train.service;

import com.ctshk.common.dto.Result;
import com.ctshk.common.dto.payment.CallPayDTO;
import com.ctshk.common.enums.ChannelMainData;
import com.ctshk.common.model.AppReq;
import com.ctshk.common.model.TokenUser;
import com.ctshk.common.req.pay.NotifyConsumeReq;
import com.ctshk.rpc.order.train.dto.TrainOrderDetailAppDTO;
import com.ctshk.rpc.order.train.req.TrainCancelOrderAppReq;
import com.ctshk.rpc.order.train.req.TrainManualOrderAppReq;
import com.ctshk.rpc.order.train.req.TrainOrderWriteReq;

/**
 * <p>
 * 火车票App订单表 服务类
 */
public interface ITrainOrderAppService {

    /**
     * 填写订单信息
     * @param trainOrderWriteReq
     * @param user
     * @return
     */
    Result<Long> writeTrainOrder(TrainOrderWriteReq trainOrderWriteReq, TokenUser user, AppReq appReq);

    Result<Long> addTrainManualOrder(TrainManualOrderAppReq trainOrderWriteReq, TokenUser user, ChannelMainData chinaTravel);

    /**
     * 订单id, 支付方式code
     * @param id
     * @param paymentMethodCode
     * @return
     */
    Result trainOrderPay(Long id, Integer paymentMethodCode);

    /**
     * 支付回调
     * @param notifyConsumeReq
     * @return
     */
    Result trainOrderNotify(NotifyConsumeReq notifyConsumeReq);

    Result trainOrderCancel(TrainCancelOrderAppReq req);

    /**
     * 订单详情
     * @param id
     * @return
     */
    Result<TrainOrderDetailAppDTO> trainOrderDetail(Long id);

    /**
     * 查询唤起支付需要的订单信息
     *
     * @param id
     * @return
     */
    CallPayDTO getCallPayInfo(Long id);

    /**
     * 回调支付接口
     *
     * @param params
     * @return
     */
    Result payment(NotifyConsumeReq params);
}
